//
//  UIBarButtonItem+GWExtension.m
//  百思不得姐
//
//  Created by qianfeng on 16/3/1.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "UIBarButtonItem+GWExtension.h"

@implementation UIBarButtonItem (GWExtension)
+(instancetype)itemWithImage:(NSString *)image highLightImage:(NSString *)highLightImage target:(id)target action:(SEL)action
{
    UIButton *btn =[[UIButton alloc]init];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:highLightImage] forState:UIControlStateHighlighted];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    btn.size =btn.currentBackgroundImage.size;
    return [[self alloc]initWithCustomView:btn];
}
@end
